<template>
	<view class="wrap">
		<view class="down" v-if="activeList.length!=0">
			<template>
				<waterfallsFlow :list="activeList" @image-click="inprov">
					<template v-slot="{item}">
						<!-- 此处添加插槽内容 -->
						<view class="cnt u-rela" @click="gotoVideoPage(item)">
							<image src="../../static/img/logofinal.png" mode="aspectFit" class="u-abso playicon"
								style="width: 40rpx;height: 40rpx;border-radius:0 50%;" @click="gotoVideoPage(item)">
							</image>
							<view class="title u-m-t-10" @click="gotoVideoPage(item)">
								<!-- <u-icon name="thumb-up-fill" class="u-m-r-10" size="32" color="#e85456" v-show="item.isTop==1"></u-icon> -->
								<span class="u-line-2 u-text-center">{{item.videoTitle}}</span>
							</view>
							<view class="demo-tag">
								<view class="tagss" @click="gotoVideoPage(item)">
									<span class="u-line-1">{{item.tips}}</span>
								</view>
								<u-icon size="40" color="#F8CB4F" name="star-fill"
									style="animation-duration: 200ms" class="animated bounceIn">
								</u-icon>
							</view>
						</view>
					</template>
				</waterfallsFlow>
			</template>
		</view>
		<view v-else>
		<u-empty text="暂无收藏记录" mode="favor" class="empty_center_icon"></u-empty>
		</view>
	</view>
</template>

<script>
import waterfallsFlow from "@/components/maramlee-waterfalls-flow/maramlee-waterfalls-flow.vue";
	export default {
		components: {
			waterfallsFlow
		},
		data() {
			return {
				activeList:[]
			};
		},
		onLoad() {
			this.getLikeVideo()
		},
		methods:{
			inprov: function(item) { //子触父事件
				this.gotoVideoPage(item)
			},
			gotoVideoPage(v) {
				console.log(v)
				const {
					id,
					videoTitle,
					videoUrl,
					createTime,
					thumbs,
					collection
				} = v  //拿需要的数据
				uni.navigateTo({
					url:`videoinfo_page?obj=${encodeURIComponent(JSON.stringify(v))}`
				})
			},
			//获取收藏的视频
			getLikeVideo() {
				this.config.get('/projectionHall/getVideosByCollection',{}).then(res => {
					console.log(res)
					let resData = res.data.data||[];
					this.activeList = this.activeList.concat(resData)
				})
			},
		}
	}
</script>

<style>
	page{
		background-color: #f3f3f3;
		
	}
</style>
<style lang="scss" scoped>
	.demo-warter {
		border-radius: 8px;
		margin: 5px;
		background-color: #ffffff;
		padding: 8px;
		position: relative;
	}

	.u-close {
		position: absolute;
		top: 32rpx;
		right: 32rpx;
	}

	.demo-image {
		width: 100%;
		border-radius: 4px;
	}

	.demo-title {
		font-size: 30rpx;
		margin-top: 5px;
		color: $u-main-color;
	}

	.playicon {
		right: 0;
		bottom: 160%;
	}
	.demo-tag {
		display: flex;
		margin-top: 5px;
		width: 100%;
		justify-content: space-between;
		align-items: center;
	
		.tagss {
			font-size: 20rpx;
			display: inline-flex;
			align-items: center;
			width: 80%;
			color: #757575;
		}
		}
		.playicon {
			left: -3px;
			bottom: 103%;
		}
</style>
